package com.haha.onebot.listener;

import com.haha.onebot.entity.ActionEvent;
import com.haha.onebot.enums.ActionType;
import com.haha.onebot.start.BotChannel;
import jakarta.annotation.Resource;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 动作事件监听
 *
 */
@Component
public class ActionEventListener {

    @Resource
    private BotChannel botChannel;

    @EventListener(ActionEvent.class)
    public void handlerResult(ActionEvent actionEvent) {
        if (ActionType.RECONNECTION.equals(actionEvent.getActionType())) {
            botChannel.reconnection();
        }
    }
}